package com.damai.utils.value;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import com.citywithincity.api.ApiBuildConfig;
import com.citywithincity.db.interfaces.IValueConvert;

class String2Date implements IValueConvert{
	String2Date(){
		
	}
	@Override
	public Object convert(Object value) {
		if(value==null)return null;
		try {
			String string= (String)value;
			if(string.length()==0)return null;
			return new SimpleDateFormat(ApiBuildConfig.DATE_TIME_FORMAT).parse(string);
		} catch (ParseException e) {
			e.printStackTrace();
			return null;
		}
	}

}
